package tk.deep.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * Created by boot on 8/27/15.
 */
public class FirstFilter implements Filter {
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("init method:");
    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

        System.out.println("doFilter now...");
        System.out.println(request.getServletContext());
        chain.doFilter(request, response);
        System.out.println("doFilter over.");

    }

    public void destroy() {
        System.out.println("destroy now ... release the system resource.");
    }
}
